Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support partially enumerable record #707

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tgfisher4
Copy link
Contributor

WIP

This PR adds support to the record combinator for "partially enumerable" records, in which the domain is the disjoint union of some enumerable type and some non-enumerable type, such that the domain has an enumerable portion and a non-enumerable portion. In particular, the record combinator enforces that the entire enumerable portion of the domain is present (with values in the codomain), and that any present keys of the non-enumerable portion have values in the codomain, emulating the type-checking behavior of TypeScript.

Other changes:

  • renamed getDomainKeys to enumerate
  • added several enumerate tests
  • implemented the partially enumerable record as an intersection of an enumerableRecord and a nonEnumerableRecord
  • supported enumeration of the intersection combinator within enumerate
  • extracted the default record.name into function for use in several places

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant